package com.bookmarket.controller;

import com.bookmarket.utils.FileUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/files")
public class LQ_FileController {

    @RequestMapping("/allFiles")
    public ModelAndView queryAllFile(HttpServletRequest request){
        ModelAndView mv = new ModelAndView();
        List<Map> list = FileUtils.readfile(request);
        mv.addObject("files",list);
        mv.setViewName("backstage/LQ_bookManager");
        return mv;
    }
}
